#ifndef NETWORK_H
#define NETWORK_H
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

typedef struct NetWrok
{
	int fd;
	int type;
	socklen_t len;
	struct sockaddr_in addr;
	
}NetWork;

typedef struct sockaddr* SP;

NetWork* open_network(char c_or_s,int type,char* ip,uint16_t port);

size_t nrecv(NetWork* nw,void* ptr,size_t len);

size_t nsend(NetWork* nw,void* ptr,size_t len);

int close_network(NetWork* nw);

#endif//NETWORK_H
